package com.esiag.loadbalancer.main;



import com.esiag.loadbalancer.impl.Notifier;

public class InfoGenerator extends Thread{
	
	private Notifier<String> mNotifier;
	

	public InfoGenerator(Notifier<String> pNotifier) {
		mNotifier = pNotifier;
		start();
	}
	
	
	@Override
	public void run() {
		int i = 0;
		while(true){
			try{
				int random = (int)(Math.random() * (300));
				Thread.sleep(random);
				mNotifier.notify("Message " + i);
				i++;
			}catch(Exception ex){
				ex.printStackTrace();
			}
		}
	}
}
